package com.nabi.starter.common.exception;

/**
 * @author CAOYOU
 * @Title: ErrCode
 * @date 2019/10/1714:03
 */
public interface ErrorCode {
    // 1000  到  -999  前端需要显示
    // -1000  到  -1999  本服务的接口异常，比如：方法报错
    // -2000  到  -2999  通过Fegin调用的异常
    // -3000  到  -3999  第三方接口详细异常
    // -4000  到  -4999  数据库详细异常
    // -5000  到  -5999  Activiti详细异常
    // -6000  到  -6999  JSON、XML、文件操作异常
    // -6000  到  -9999  业务详细异常,比如：认证失败
    // -10000  到  -99999  参数详细异常，比如：非空异常等


    ApiCode OK = new ApiCode(0, "操作成功");
    ApiCode DATA_EXIST = new ApiCode(-1, "该记录已存在");
    ApiCode DATA_NOT_EXIST = new ApiCode(-2, "该记录不存在");
    ApiCode BUSINESS_ERR = new ApiCode(-3, "业务异常");
    ApiCode OPERATION_FAILURE = new ApiCode(-4, "操作失败");
    ApiCode PARAM_ERROR = new ApiCode(-5, "参数错误");
    ApiCode NOT_PERMISSION = new ApiCode(-6, "没有权限");
    ApiCode TOKEN_INVALID = new ApiCode(-7, "无效token");
    ApiCode LOGIN_FAILED = new ApiCode(-8, "登录失败");
    ApiCode TOKEN_LOGIN_INVALID = new ApiCode(-9, "会话超时，请重新登录");
    ApiCode REQUEST_TIME_OUT = new ApiCode(-7, "请求超时");
    ApiCode DATA_EXCEPTION = new ApiCode(-8, "数据异常");
    ApiCode OPERATING_FREQUENCY = new ApiCode(-97, "操作过于频繁，请等待30秒再试");
    ApiCode SYSTEM_ERR = new ApiCode(-99, "系统繁忙，请稍候再试");
    ApiCode NETWORK_ERR = new ApiCode(-98, "网络繁忙，请稍候再试");


    ApiCode INTERNAL_ERROR = new ApiCode(-500, "内部异常");

    ApiCode API_ERROR = new ApiCode(-2000, "Fegin内部调用异常");
    ApiCode INTERNAL_ERR_GENERATE = new ApiCode(-2001, "文书生成失败");
    ApiCode INTERNAL_ERR_CLASS_INIT = new ApiCode(-2002, "类初始化失败");
    ApiCode INTERNAL_ERR_CLASS_INVALID = new ApiCode(-2003, "类无效");


    ApiCode OTHER_API_ERR = new ApiCode(-3000, "第三方接口异常");
    ApiCode OTHER_API_ERR_EMAIL_SEND = new ApiCode(-3001, "邮件发送失败");
    ApiCode OTHER_API_ERR_SMS_SEND = new ApiCode(-3002, "短信发送失败");
    ApiCode OTHER_API_ERR_INMAIL_SEND = new ApiCode(-3003, "站内信发送失败");


    ApiCode DB_ERROR = new ApiCode(-4000, "操作数据异常");


    ApiCode FILE_OPERATE_ERR = new ApiCode(-6000, "JSON、XML、文档转换异常");
    ApiCode FILE_OPERATE_JSON = new ApiCode(-6001, "JSON解析失败");
    ApiCode FILE_OPERATE_XML = new ApiCode(-6002, "XML解析失败");
    ApiCode FILE_OPERATE_TEMPLATE_TRANSITION = new ApiCode(-6003, "模板转换失败");
    ApiCode FILE_OPERATE_SEARCH_KEY = new ApiCode(-6004, "读取文书关键字异常");
    ApiCode FILE_OPERATE_FLIE_MAX = new ApiCode(-6005, "文件过大");
    ApiCode FILE_OPERATE_NOT_EXIST = new ApiCode(-6006, "文件不存在");
    ApiCode FILE_OPERATE_EXIST = new ApiCode(-6006, "文件已存在");
    ApiCode FILE_OPERATE_CONVERT = new ApiCode(-6006, "文件转换失败");
    ApiCode FILE_OPERATE_UPLOADING = new ApiCode(-6007, "上传文件失败");

    ApiCode INVALID_THEME = new ApiCode(-7000, "无效MQ主题");
    ApiCode THEME_EXIST = new ApiCode(-7001, "MQ主题已存在");
    ApiCode SCAN_ERROR = new ApiCode(-7002, "扫描文件异常");
    ;
    ApiCode LOCK_LOADER_NOT_EXIST = new ApiCode(-7003, "锁加载器不存在");

    Integer getCode();

    String getMsg();

    Integer getErrorCode();

    String getErrorMsg();
}
